home *** CD-ROM | disk | FTP | other *** search
- ;* SCHEME.INI
- ;************************************************************************
- ;* *
- ;* PC Scheme/Geneva 4.00 Scheme Startup code *
- ;* *
- ;* (c) 1985-1988 by Texas Instruments, Inc. See COPYRIGHT.TXT *
- ;* (c) 1992 by L. Bartholdi & M. Vuilleumier, University of Geneva *
- ;* *
- ;*----------------------------------------------------------------------*
- ;* *
- ;* Starts up a cozy environment for the user *
- ;* *
- ;*----------------------------------------------------------------------*
- ;* *
- ;* Created by: L. Bartholdi Date: 1992 *
- ;* Revision history: *
- ;* - 18 Jun 92: Renaissance (Borland Compilers, ...) *
- ;* - 1 Sep 92: Added history auto-restore support (lb) *
- ;* - 25 Oct 92: Added extended pcs-machine-type and gimso (lb) *
- ;* - 1 Dec 92: Moved history to default dir, check if exists (mv) *
- ;* - 9 Jan 93: Added IO error handler, macro keys, tab completion (mv) *
- ;* *
- ;* ``In nomine omnipotentii dei'' *
- ;************************************************************************
-
- ; these are here just for portabability purposes.
- ; (define t #T)
- ; (define nil #F)
-
- ; history.ini is a computer-generated file updated
- ; at each (exit) call with errorlevel 0.
- ; it is supposed to look like:
- ; (%push-history (quote ("(exit)" "..." "...")))
- (if (file-exists? "HISTORY.INI")
- (load "HISTORY.INI"))
-
- ; an sample io error handler, more friendly than INSPECT
- (load (%system-file-name "errhand.fsl"))
-
- ; this installs a support for the Brief(TM) editor.
- ; it declares a routine, (b), that spawns the editor.
- ; uncomment it if you have Brief installed
- ;(load (%system-file-name "b.fsl"))
-
- ; this installs a support for EdLISP, a cute tiny editor
- ; by a French team.
- ; it declares a routine, (edlisp), that spawns the editor.
- ; uncomment it if you want to use edlisp
- ; Don't forget to add \...\scheme\edlisp in your path !
- ;(load (%system-file-name "edlisp.fsl"))
-
- ; this is how to create a scheme editor running under PCS/Gva
- ; uncomment this line if you want to use it
- ;(define ed (make-scheme-editor))
-
- ; this is a personal configuration, so I know all's OK.
- ;(when (eq? (dos-get-env "USER") "LBARTHO")
- ; (set! pcs-gc-reset "PCS [Free: scheme=%lu, kernel=%lu]")
- ; (window-set-attribute! 'console 'text-attributes #h4e))
-
- ; this installs a few things on my HP95lx.
- ; it's a PC-compatible but has a smaller screen (40x16)
- ; and non-standard graphics.
- (when (equal? (caddr pcs-machine-type) -29633)
- (set! pcs-gc-reset "PC Scheme/Geneva 4.02")
- (window-set-size! 'console 15 80)
- (window-set-size! pcs-status-window 1 80)
- (window-set-position! pcs-status-window 15 0)
- (set-car! max-console 16)
- (install-user-driver "HP95")) ; BGI graphics
-
- ; Now define macro keys
- ; 59 -> 68 are function keys F1 -> F10
- (define pcs-macro-keys '(
- (59 "(b)") ; F1: my dos editor
- (60 "(ed)") ; F2: my scheme editor
- (61 "(set! pcs-debug-mode #T)") ; F3: include debug info
- (62 "(set! pcs-debug-mode '())") ; F4: exclude debug info
- (63 . "(fast-load (%system-file-name \""); F5: load a package
- (64 . "(load \"") ; F6: load a file
- (65 . "(fast-save-file \"") ; F7: precompile a file
- (68 "(exit)"))) ; F10: exit
-
- ; This is how to teach PCS/GE
- ; to complete with TAB symbols neither
- ; bounds in global environment, nor
- ; autoloadable, nor having properties
- (pcs-learn-symbols '(CONSOLE TEXT-ATTRIBUTES BORDER-ATTRIBUTES))
-
- ; in case you're interested in LISP's (LOOP) macro ...
- ; uncomment the following lines
- ; see also Common Lisp Compatibility Package (CLCP.FSL)
- ;(macro loop
- ; (lambda (form)
- ; (let* ((me (gensym))
- ; (explode (named-lambda (explode pairs)
- ; (cond ((null? pairs) `((,me)))
- ; ((eq? (caar pairs) 'COND)
- ; (let ((test (cadar pairs))
- ; (if-true (cddar pairs))
- ; (if-false `(BEGIN ,@(explode (cdr pairs)))))
- ; (if (null? if-true)
- ; (let ((temp (gensym)))
- ; `((LET ((,temp ,test))
- ; (IF ,test ,test ,if-false))))
- ; `((IF ,test (BEGIN ,@if-true) ,if-false)))))
- ; (else (cons (car pairs) (explode (cdr pairs)))))))
- ; )
- ; `(LETREC ((,me (lambda () ,@(explode (cdr form)))))
- ; (,me)))))
-
- ; Finally, the start-up !
-
- (newline)
- (writeln "SCHEME.INI loaded. Good luck.")
- (set! pcs-debug-mode #T)